
Class.create("Graphics", {
	id: null,
	handle: null,
	context: null,
	__static:
		{
			dummy: null,
			isSupported: function()
			{
				if(!dummy)
				{
					this.dummy = $('<canvas />')[0];
				}
				return !!!this.dummy.getContext;
			}
		},
	__construct: function(id, width, height)
	{
		this.id = id;
		this.handle = $('<canvas />').attr('id', id)[0];
		$(window)[0].oncontextmenu = function() { return false; }
		this.context = this.handle.getContext('2d');
		if(!width)
			width = 0;
		if(!height)
			height = 0;
		this.context.canvas.width = width;
		this.context.canvas.height = height;
	},
	width: function(value)
	{
		if(!value)
		{
			return this.context.canvas.width;
		}
		this.context.canvas.width = value;
	},
	height: function(value)
	{
		if(!value)
		{
			return this.context.canvas.height;
		}
		this.context.canvas.height = value;
	},
	drawImage: function(sprite, x, y)
	{
		this.context.drawImage(sprite.canvas, x, y);
	},
	drawImageResized: function(sprite, x, y, w, h)
	{
	},
});